<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/layui/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <input type="hidden"name="id" value="${advertiser.id}"  >
    <table class="layui-table">
        <colgroup>
            <col width="150">
            <col width="200">
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>公司信息</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td>公司名称：${advertiser.companyName}</td>
            <td>公司地址：${advertiser.companyAddress}</td>
        </tr>
        <tr>
            <td>公司网站地址：${advertiser.companyUrl}</td>
            <td>公司官方微博：无</td>
        </tr>
        <tr>
            <td>公司描述：${advertiser.companyDescribe}</td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>联系人：${advertiser.linkman}</td>
            <td>联系人电话：${advertiser.phoneNum}</td>
        </tr>
        <tr>
            <td>E—mail：${advertiser.email}</td>
            <td>微信：${advertiser.wechat}</td>
        </tr>
        </tbody>
    </table>
</div>
<script src="/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            // var index = layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // }, function () {
            //
            //     // 关闭弹出层
            //     layer.close(index);
            //
            //     var iframeIndex = parent.layer.getFrameIndex(window.name);
            //     parent.layer.close(iframeIndex);
            //
            // });
            $.ajax({
                url:'/admin/Advertiser/modify',
                type:'post',
                data:JSON.stringify(data.field),
                contentType:'application/json',
                dataType:'json',
                success: function (result){
                    if (result.code == '0'){
                        //关闭出层
                        layer.close();
                        //刷新表格
                        parent.window.location.reload();

                    }
                }
            });

            return false;
        });

    });
</script>
</body>
</html>